package com.dqsf.demo_springboot.controller;

import com.dqsf.demo_springboot.model.Hero;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
//@Controller
public class HelloController {
    @RequestMapping("/hello")
    public String hello(){
        return "hello";
    }
    @RequestMapping("/hello1")
    public String hello(String name,String id){
        return "hello "+name+" !!!"+id;
    }
    @RequestMapping("/hello/{name}")
    public String hello1(@PathVariable String name){
        return "hello "+name+" !!!";
    }

    @RequestMapping(value = "/gethero",method = RequestMethod.POST)
    public Hero getHero(){
        return new Hero(1002,"大宝剑",1000);
    }


}
